package com.niit.service.impl;

import com.niit.dao.ConsumerMapper;
import com.niit.pojo.Consumer;
import com.niit.service.ConsumerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@Service
public class ConsumerServiceImpl implements ConsumerService {
    @Autowired
    private ConsumerMapper consumerMapper;

    @Override
    public List<Consumer> getAllConsumers() {
        return consumerMapper.getAllConsumers();
    }
    @Override
    public void addConsumer(Consumer consumer) {
        consumerMapper.addConsumer(consumer);
    }
    @Override
    public void editConsumer(Consumer consumer) {

        consumerMapper.editConsumer(consumer);
    }

    @Override
    public void deleteConsumer(String consumerId) {
        consumerMapper.deleteConsumer(consumerId);
    }
    @Override

    public void updateConsumer(Consumer consumer) {
        consumerMapper.updateConsumer(consumer);
    }


    @Override
    public Consumer getConsumerById(String consumerId) {
        return consumerMapper.getConsumerById(consumerId);
    }
}
